import { createRouter, createWebHistory } from 'vue-router'

import Home from '@/views/home/index.vue'
import index from '@/views/home/home.vue'
import cart from '@/views/home/cart.vue'
import cal from '@/views/home/cal.vue'
import my from '@/views/home/my.vue'
import login from '@/views/login/index.vue'
import search from '@/views/search/index.vue'
import detail from '@/views/detail/index.vue'
import dd from '@/views/dd/index.vue'
import wl from '@/views/wl/index.vue'
import djs from '@/views/djs/index.vue'
import qb from '@/views/qb/index.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Home,children:[
        {path:'index',component:index},
        {path:'cart',component:cart},
        {path:'cal',component:cal},
        {path:'my',component:my},
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: login,
    },
    {
      path: '/search',
      name: 'search',
      component: search,
    },
  
    {
      path: '/detail/:goods_id',
      name: 'detail',
      component: detail,
    },
    {
      path: '/dd',
      name: 'dd',
      component: dd,
    },
    {
      path: '/wl',
      name: 'wl',
      component: wl,
    },
      {
      path: '/djs',
      name: 'djs',
      component: djs,
    },
    {
      path: '/qb',
      name: 'qb',
      component: qb,
    },
  ],
})

export default router
